﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using Sinacor.Infra.UI.Common;

namespace Sinacor.Infra.UI.Controls.SmartClient
{
    internal class CurrentChangedEventManager : BaseWeakEventManager<CurrentChangedEventManager, ItemCollection, EventArgs>
    {
        protected override void StartListening(object source)
        {
            ItemCollection s = source as ItemCollection;
            if (s != null)
                s.CurrentChanged += new EventHandler(HandleEvent);
        }

        protected override void StopListening(object source)
        {
            ItemCollection s = source as ItemCollection;
            if (s != null)
                s.CurrentChanged -= new EventHandler(HandleEvent);
        }
    }
}
